
<?php include_once 'common/header.php';  ?>
<!-- admin_main -->
<div class="admin_main">
	<!-- Admin_top end -->
	<?php include_once 'common/site_left.php';  ?>
	<!-- Admin_Left End -->
	<div class="admin_right">
		<div class="admin_right_title">
			<strong>栏目管理</strong> &gt;&gt;  友情链接列表
		</div>
		<div class="admin_right_con">
			<table border="0" cellspacing="1" cellpadding="0" bgcolor="#CCCCCC">
			  <tr style="color:#0068b7;">
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>编号</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>类型</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>URL</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>站点名称</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>logo</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>顺序</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>操作</strong></td>
			  </tr>
			  <?php foreach($links_list as $key=>$links){?>
			  <tr id="row_<?php echo $links['id'];?>">
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $links['id'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $links['type']==1?'友情链接':'合作伙伴';?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $links['url'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $links['webname'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF">
				<img src="<?php echo LINKS_IMG.$links['logoimg'];?>" width="100" height="33"  />
			  	</td>
			  	<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $links['forder'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF">
				<a href="/ychadmin/links/edit_view/<?php echo $links['id'];?>">编辑</a>
				<a href="javascript:if(confirm('确定删除文章？')){remove(<?php echo $links['id'];?>);}">删除</a>
				</td>
			  </tr>
			  <?php }?>
			  <tr>
				<td colspan="7" align="right">
				<form action="/ychadmin/links/linkslist" method="get">标题：<input
					type="text" id="webname" name="webname" value="<?php echo $webname?>" />
				<select id="type" name="type">
					<option value="0">--请选择类型--</option>
					<option <?php if($type == 1){?> selected="selected" <?php }?>
						value="1">友情链接</option>
					<option <?php if($type == 2){?> selected="selected" <?php }?>
						value="2">合作伙伴</option>
				</select> <input type="submit" value="查询" /></form>
				</td>
			</tr>
			<tr>
				<td colspan="7" height="35" align="center" valign="middle"
					bgcolor="#FFFFFF" class="page"><?php echo $this->pagination->create_links();?></td>
			</tr>
	
			</table>
			</div>
	</div>
<!-- Admin_Right End -->
</div>
<!-- admin_main end -->
<script>
function remove(id){
	$.ajax({
		type: "post",
		url: "/ychadmin/links/remove/",
		data: "id="+id,
		success: function(msg){
			$("#dialog" ).dialog();
			if(msg == 1){
				$("#msg").html("删除成功！");
				$("#row_"+id).hide();
			}else{
				$("#msg").html("删除失败，请联系管理员！");
			}
			setTimeout(function(){
				$("#dialog" ).dialog("close");
			},3000);
		},
		dataType: "text"
	});
}
</script>
<div id="dialog" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>
</body>
</html>
